/*
* Copyright (C) Microsoft. All rights reserved.  
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not 
* use this file except in compliance with the License.  You may obtain a copy 
* of the License at http://www.apache.org/licenses/LICENSE-2.0  
* 
* THIS CODE IS PROVIDED *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED 
* WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, 
* MERCHANTABLITY OR NON-INFRINGEMENT. 
*
* See the Apache License, Version 2.0 for specific language governing 
* permissions and limitations under the License.
*
*/
#pragma once

#include <baja/app/input.hpp>

namespace baja { namespace app {

struct iapp_shell_service : public ibase
{
    BAJA_INTERFACE(iapp_shell_service, "A4440389-D548-42A8-A4A1-4732080C534E")

    virtual baja::uint32 touchPointCount() = 0;
    virtual const std::map<uint32, pointer_args>& touchPoints() = 0;
    virtual orientation orientation() = 0;
    virtual float32 logicalDpi() = 0;
    virtual const m::point2d& windowSize() = 0;
    virtual void enableInertia(const float32 deceleration) = 0;
    virtual void disableInertia() = 0;
    virtual void clearTile() = 0;
    virtual void updateTile(const std::wstring&) = 0;
};

struct iapp_shell_base : public iinput_relay
{
    BAJA_INTERFACE(iapp_shell_base, "3E75B888-0F21-4458-B3C9-6124DB6ADC19")

    virtual void setApp(const std::shared_ptr<iapp>& app) = 0;
};

struct iapp_shell : public iapp_shell_base
{
    BAJA_INTERFACE(iapp_shell, "C1F1ED8D-97F9-41CE-B97B-273A400017F1")

    virtual void run() = 0;
};

struct iloopless_app_shell : public iapp_shell_base
{
    BAJA_INTERFACE(iloopless_app_shell, "D353CCFC-CD68-441E-BB57-AE8C461D70C6")

    virtual void render() = 0;
};

}} // namespace baja::app

#ifdef BAJA_CONFIG_APP_BASIC
#include <baja/app/basic/shell_impl.hpp>
#elif defined(BAJA_CONFIG_APP_DIRECTUI)
#include <baja/app/directui/shell_impl.hpp>
#else
#error unsupported
#endif
